Index ¦ Archives ¦ RSS

Interdependent tracked changes improvements in Writer

Estimated read time: 4 minutes

Writer has some support for interdependent (or hierarchical) tracked changes: e.g. the case when you have a delete on top of an insert. While there were some working cases, handling of many combinations were missing. I started to make systematic improvements in this area in the recent past, this post gives you an overview what's done so far.

This work is primarily for Collabora Online, but the feature is available in desktop Writer as well.

Motivation

DOCX files in Word can often have overlapping tracked changes: Writer tries to split these up to make sure there is only one tracked change under the cursor at the same time. Still, it's possible that you have a tracked change with multiple types: e.g. a delete on top of an insert.

The focus in on 3 combinations which appear in DOCX files a lot: "insert, then delete", "insert, then format" and "delete, then format".

This mostly affects the UI and import/export filters of ODT and DOCX.

Results so far

Given an insert, then delete:

Interdependent tracked change: insert, then delete

Most operations worked nicely here, but in case your cursor was in the middle of AAA and you did a reject, followed by an undo, proper handling of that was missing, now implemented.

But then given an insert, then a format:

Interdependent tracked change: insert, then format

Then a handling of more actions were missing:

  1. DOCX import is now implemented.
  2. ODT import is now implemented.
  3. Accepting when you're inside AAA is now implemented: the insert is accepted for BBB but the format stays unchanged.
  4. Rejecting when you're inside AAA is now implemented: the insert is rejected and BBB is also removed, together with the format on top of it.
  5. Accepting the BBB now correctly operates on the insert type, so the format type remains after accept.
  6. If you accept BBB, now the surrounding AAA and CCC also get accepted as well, as expected.
  7. Now if you reject BBB, then it gets removed from the document, since you rejected an insert.
  8. When you reject BBB, the surrounding AAA and CCC also get rejected.

The combined implementation of these should give you a smooth feeling in case you're used to how Word works: if there is a format redline combined with an insert, then the operations act on the insert type, and format is only accepted/rejected when there is no insert "under" the format.

Similarly: it's a bit of an implementation detail that Writer splits redlines on DOCX import: so if you e.g. accept AAA then we combine that with BBB and CCC when it makes sense, so you need to click a lot less.

Finally, given a delete, then a format:

Interdependent tracked change: delete, then format

Then again handling of some actions were missing:

  1. DOCX import is now implemented.
  2. ODT import is now implemented.
  3. ODT export is now implemented.
  4. Accepting AAA now correctly operates on the delete type of BBB.
  5. Rejecting AAA now correctly operates on the delete type of BBB.
  6. Accepting BBB now correctly works with the delete type.
  7. Accepting BBB now correctly tries to also accept AAA and CCC, too.

The current state is not yet complete, but it's a big improvement over what we had in the past, which was mostly focusing on just "insert, then delete".

You may wonder what about some other cases: if you insert some content with change tracking, that always creates a new tracked change, so "insert" is never on top of something else. Similarly, format is always on top of something. Finally the same type is never on top of itself.

How is this implemented?

If you would like to know a bit more about how this works, continue reading... :-)

As usual, the high-level problem was addressed by a series of small changes. Core side:

Want to start using this?

You can get a development edition of Collabora Online 25.04 and try it out yourself right now: try the development edition. Collabora intends to continue supporting and contributing to LibreOffice, the code is merged so we expect all of this work will be available in TDF's next release too (25.8).

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.